package com.jgp.glmeeting.controller;

import com.jgp.glmeeting.model.Meeting;
import com.jgp.glmeeting.service.MeetingService;
import com.jgp.sys.common.controller.JGPController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/glMeeting/meetingController")
public class MeetingController extends JGPController {
    @Autowired
    private MeetingService meetingService;
    //跳转listMeeting页面
    @RequestMapping("/listMeeting")
    public String listMeeting(){

//        String fileId = "";
//
//        List<File> files = DocUtil.getIOFiles(null);
//
//        File iamge =  files.get(0);
//        
        return   page("listMeeting");
    }
    //跳转会议添加M
    @RequestMapping("/addMeeting")
    public String addMeeting(){
        return   page("addMeeting");
    }


    //跳转资料管理
    @RequestMapping("/dataManage")
    public String dataManage(){
        return   page("dataManage");
    }


    //    //改是...先查询在改
    @RequestMapping("/editMeeting/{id}")
    public String editMeeting(@PathVariable String id,Model model){
        Meeting m=meetingService.queryID(id);
        re(model,"editMeeting",m);
        return page("editMeeting");
    }

    //点击上传附件
    @RequestMapping("/addUpload/{id}")
    public String addUpload(@PathVariable String id,Model model){
        Meeting m=meetingService.queryID(id);
        model.addAttribute("meetingID",id);
        re(model,"edita",m);
        return page("addUpload");
    }

    //点击查看所有附件
    @RequestMapping("/lookfiles/{id}")
    public String lookfiles(@PathVariable String id,Model model){
        Meeting m=meetingService.queryID(id);
        re(model,"edita",m);
        return page("lookfiles");
    }

    //座次安排
    @RequestMapping("/showSeating/{id}")
    public String addSeating(@PathVariable String id,Model model){
//        System.out.print("啊啊啊啊啊啊啊啊啊啊啊啊"+id);
      model.addAttribute("meetingID",id);
        return page("showSeating");
    }

}
